package com.wuzf.demo.demo.bootstrap;


import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * 自动装配
 * 手动装配+spring.factories
 */
@EnableAutoConfiguration
public class EnableAutoHelloWorldBootstrap {

    public static void main(String[] args) {

        ConfigurableApplicationContext context = new SpringApplicationBuilder(EnableAutoHelloWorldBootstrap.class)
                .web(WebApplicationType.NONE)
                .run(args);

        String result = context.getBean("helloWorld", String.class);
        System.out.println("Hello World Bean:" + result);

        context.close();
    }

}
